<template>
    <div>
        <!-- 头部标题区域 -->
       <div class="top">
            <h3 class="title">{{Goodsdescinfo.title}}</h3>
       </div>
       <!-- 内容区域 -->
       <div class="content" v-html="Goodsdescinfo.content">
           {{Goodsdescinfo.content}}
       </div>
    </div>
</template>
<script>
export default {
    data () {
        return {
            //图文介绍的内容
            Goodsdescinfo:{}
        };
    },
    created() {
        this.getGoodsdesc()
    },
    methods:{
        //获取商品的图文信息
        async getGoodsdesc() {
            const id = this.$route.params.id - 0
            const {data:res} = await this.$http(`/api/goods/getdesc/${id}`)
            this.Goodsdescinfo = res.message[0]
            console.log(this.Goodsdescinfo);
        }
    }
}
</script>
<style scoped lang="less">
    .top {
        height: 2rem;
        line-height: 2rem;
        border-bottom: 0.5px solid #ccc;
        margin-bottom: 10px;
    }
    .title {
        text-align: center;
        font-size: 0.6rem;
        color: #226aff;
    }
    .content {
        font-size: 0.6rem;
    }
</style>